package com.iweb.day03;

/**
 * @author WuYongheng
 * @date 2021/10/24
 * @description
 */
public class NormalSearchDemo {
    public static void main(String[] args) {
        int[] array = {42, 65, 15, 78, 30};
        int index = -1;

        int target = 15;
        for (int i = 0; i < array.length; i++) {
            if (array[i] == target){
                index = i;
                break;
            }
        }
        if (index != -1) {
            System.out.println("找到了,下标为：" + index);
        } else {
            System.out.println("没找到");
        }
    }
}
